(function () {
    const closeds = document.querySelectorAll('.closed');
    const loginBtn = document.querySelector('.btn-pointer');
    const gologs = document.querySelectorAll('.golog');
    const loginbox = document.querySelector('.login-box');
    const forgets = document.querySelectorAll('.forget');

    // 点击关闭按钮跳转首页
    for (let i = 0; i < closeds.length; i++) {
        closeds[i].addEventListener('click', function () {
            window.location.href = './index.html';
        })
    }
    // 切换注册页
    loginBtn.addEventListener('click', function () {
        loginbox.style.left = -400 + 'px';
    })
    // 切换登录页
    for (let i = 0; i < gologs.length; i++) {
        gologs[i].addEventListener('click', function () {
            loginbox.style.left = 0 + 'px';
        })
    }
    // 登录页,注册页切换找回密码页
    for (let i = 0; i < forgets.length; i++) {
        forgets[i].addEventListener('click', function () {
            loginbox.style.left = -800 + 'px';
        })
    }

})();